﻿<ChartingDashboard:WindowBase x:Class="CodeGears.WorkItemTracking.ChartingDashboard.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:themes="clr-namespace:WPF.Themes;assembly=WPF.Themes"
    xmlns:ChartingDashboard="clr-namespace:CodeGears.WorkItemTracking.ChartingDashboard"
    themes:ThemeManager.Theme="TwilightBlue"
    Title="Work Items Charting Dashboard by CodeGears" Height="400" Width="924" WindowStartupLocation="CenterScreen" WindowState="Maximized"
    x:Name="Window">
	<Window.Resources>
		<Storyboard x:Key="AfterLogIn">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.8000000" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Window.Resources>
	<Window.Background>
		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
			<GradientStop Color="#FF61B7C3" Offset="0.474"/>
			<GradientStop Color="#FF87F0FF"/>
			<GradientStop Color="#FF004953" Offset="1"/>
		</LinearGradientBrush>
	</Window.Background>
    <DockPanel>
		<Grid DockPanel.Dock="Top">
			<Grid.ColumnDefinitions>
                <ColumnDefinition Width="550"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
	        <Label x:Name="label" Grid.Column="0" Content="Work Items Charting Dashboard" FontSize="28" FontFamily="Trajan Pro" VerticalAlignment="Center"/>
	        <Grid x:Name="grid"  Grid.Column="1">
	            <Grid.ColumnDefinitions>
	                <ColumnDefinition Width="56"></ColumnDefinition>
	                <ColumnDefinition></ColumnDefinition>
	                <ColumnDefinition Width="90"></ColumnDefinition>
	            </Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
				<RowDefinition></RowDefinition>
				<RowDefinition></RowDefinition>
				</Grid.RowDefinitions>
	            <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">Zoom X:</Label>
	            <Slider Grid.Column="1" VerticalAlignment="Center" Orientation="Horizontal" x:Name="sxZoom" Value="1" Minimum="0.2" Maximum="3"></Slider>
				<Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center">Zoom Y:</Label>
	            <Slider Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Orientation="Horizontal" x:Name="syZoom" Value="1" Minimum="0.2" Maximum="3"></Slider>
	            <Button Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Center" Margin="5,0,0,0" Command="{Binding AddChartCommand}">Add chart</Button>
	        </Grid>
		</Grid>
        
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <WrapPanel x:Name="LayoutRoot">
                <WrapPanel.LayoutTransform>
                    <ScaleTransform CenterX="0" CenterY="0"
                ScaleX="{Binding ElementName=sxZoom,Path=Value}"
                ScaleY="{Binding ElementName=syZoom,Path=Value}"/>
                </WrapPanel.LayoutTransform>
            
            </WrapPanel>
        </ScrollViewer>
        <Popup x:Name="LoginPopup"
               PlacementTarget="{Binding ElementName=Window}"           
               AllowsTransparency="True"
               PopupAnimation="Slide"
               Placement="Center"
               Width="350">
            <Border BorderBrush="White" BorderThickness="0 0 0 2">
                <Grid Margin="0 0 0 5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70"></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    
                    <Label Grid.Row="0" Grid.ColumnSpan="3"
                           HorizontalAlignment="Center" FontSize="17" FontFamily="Trajan Pro"
                           Foreground="White">Please provide your server address</Label>
                    <Label Grid.Row="1" Grid.Column="0" Foreground="White">Server:</Label>
                    <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding ServerAddress}"></TextBox>
                    <Button Grid.Row="2" Grid.Column="2" Margin="0 3 0 0"
                            Command ="{Binding ConnectCommand}">Connect</Button>
                </Grid>
            </Border>
        </Popup>
    </DockPanel>
</ChartingDashboard:WindowBase>
